// 获取推荐歌单

// const express = require('express');
// const app = express();
const Http = require('../util/request');
const crypto = require('crypto')

module.exports = (query, request) => {
    // console.log(query)
    query.cookies.os = 'pc'
    const data = {
        phone: query.query.phone,
        countrycode: query.query.countrycode  || '86',
        password: crypto.createHash('md5').update(query.query.password).digest('hex'),
        rememberLogin: 'true'
    };
    Http(
        'POST', `https://music.163.com/weapi/login/cellphone`, data,
        {crypto: 'weapi', ua: 'pc', cookie: query.cookies, proxy: query.proxy}
    ).then(res => {
        request.append('Set-Cookie', res.cookie)
        request.json(res)
    }).catch( err => {
        request.json(err)
    })
};
